<?php
Session::init();
$lang = Session::get('lang');
if ($lang == null) {
    $lang = 'eng';
    Session::set('lang', $lang);
}
?>

<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta name="keywords" content="<?php echo $this -> _keywords; ?>" />
		<meta name="description" content="<?php echo $this -> _desc; ?>" />
		<title>Zevel</title>

		<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.2.1/base-min.css">
		<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.2.1/pure-min.css">
		<link href="<?php echo PUB; ?>css/main.css" rel="stylesheet" type="text/css" />

		<!--<link href="<?php echo PUB; ?>css/adminBar.css" rel="stylesheet" type="text/css" />-->
		<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
		<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script>
		<?php
        if (isset($this -> js)) {
            foreach ($this->js as $js) {
                echo '<script type="text/javascript" src="' . URL . 'views/' . $js . '"></script>';
            }
        }
		?>
	</head>
	<body>
	    <div class="container">
		<header>
			<div class="pure-menu pure-menu-open pure-menu-fixed pure-menu-horizontal">
				<a href="<?php echo URL; ?>" class="pure-menu-heading">home</a>
				<ul>
					<?php if(Session::get('user') == null) : ?>
					<li>
						<a href="<?php echo URL; ?>login">Login</a>
					</li>
					<?php else : ?>
					<li>
						<a href="<?php echo URL; ?>login/logout">logout</a>
					</li>
					<li>
                        <a href="<?php echo URL; ?>myItems">My Items</a>
                    </li>
					<?php
					$user = Session::get('user');
					if($user['role'] == 1) : ?>
					<li>
						<a href="<?php echo URL; ?>user">Users</a>
						<ul>
							<a href="<?php echo URL; ?>user/add">Add</a>
						</ul>
					</li>

					<li>
						<a href="<?php echo URL; ?>category">Category</a>
						<ul>
							<a href="<?php echo URL; ?>category/add">Add</a>
						</ul>
					</li>

					<li>
						<a href="<?php echo URL; ?>item">Items</a>
						<ul>
							<a href="<?php echo URL; ?>item/add">Add</a>
						</ul>
					</li>
					<?php else : ?>
					<li>
						<a href="<?php echo URL; ?>account">Account</a>
					</li>
					<li>
						<a href="<?php echo URL; ?>category">Message</a>
					</li>
					<?php endif; ?>
					<?php endif; ?>
				</ul>
			</div>

			<div class="pure-g-r">
				<div class="pure-u-1-4">

					<img src="<?php echo PUB; ?>/images/tcc.jpg"
					alt="Placeholder image for example.">

				</div>

				<div class="pure-u-2-3">
					<div class="l-box splash-text">
						<h1 class="splash-head"> Zevel - Second Hand Market </h1>

						<h2 class="splash-subhead"> Free public market for used products and handmade creations. </h2>

						<p>
							Baglama DevTeam
						</p>
					</div>
				</div>
			</div>

		</header>

